package com.example.crossmall.service;

import com.example.crossmall.po.Admin;
import com.example.crossmall.po.AdminExample;
import org.springframework.data.domain.Example;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.Pageable;

import javax.servlet.http.HttpServletRequest;
import java.util.List;

public interface AdminUserService {
    /**
     * 根据id查询
     *
     * @param id
     * @return
     */
    Admin findById(int id);


    /**
     * 分页查询所有
     *
     * @param pageable
     * @return
     */
    Page<Admin> findAll(Pageable pageable);

    /**
     * 按条件查询
     *
     * @param example
     * @return
     */
    List<Admin> findAllExample(AdminExample example);

    /**
     * 更新
     *
     * @param adminUser
     * @return
     */
    void update(Admin adminUser);

    /**
     * 创建
     *
     * @param adminUser
     * @return
     */
    int create(Admin adminUser);

    /**
     * 根据Id删除
     *
     * @param id
     * @return
     */
    void delById(int id);

    /**
     * 检查登录
     * @param request
     * @param username
     * @param pwd
     * @return
     */
    Admin checkLogin(HttpServletRequest request, String username, String pwd);

}
